<?php

require 'conn.php';

require 'config.php';

require 'inc/function.php';
$ye='news';

$keywords=$_GET['search_key'];

 ?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>


<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=1200,initial-scale=0.3,maximum-scale=1.0,user-scalable=yes" />
<?php 
$query=mysql_query('select * from '.$language.'_keywords where k_id=4',$conn);
$row=mysql_fetch_array($query);

$k_name=$row['k_name'];

$k_keyword=$row['k_keyword'];

$k_description=$row['k_description'];
?>
<title><?php echo '搜索中心 -'.$k_name?></title>
<meta name="keywords" content="<?php echo $k_keyword?>" />
<meta name="description" content="<?php echo $k_description?>" />
 <link rel="stylesheet" rev="stylesheet" href="css/global.css" />

<link rel="stylesheet" rev="stylesheet" href="css/style.css" />
<script type="text/javascript" src="js/jq_min.js"></script>
     <script type="text/javascript" src="inc/function.js"></script>
</head>
<body>
<!-- haeder S-->
<?php require 'header.php'?>
 
<div id="ban" style="background:url(<?php echo RsField('select b_image from '.$language.'_banner where b_id=4')?>) center no-repeat;"></div>

        <div id="center">
        	<div class="main clear_both">
             	<div class="left fl">
	    <div class="about">新闻中心   </div>
    <div class="list">
        <ul>
        	          
                 <?php
                  $str='';

		$query=mysql_query('select n_id,n_name from '.$language.'_news_class order by n_order asc');

		if (mysql_num_rows($query)>0){

		while($row=mysql_fetch_array($query)){
			$str.=' <li>';
			  $str.=' <div class="senior">';
			   $str.='<a href="news.php?id='.$row['n_id'].'">'.$row['n_name'].'</a> </div></li> ';
		}

		}
 
				 echo $str;
				  ?>
              
                    </ul>
    </div>
 
    
</div> 
            	<div class="right fr clear_both">
                	<div class="mbx fl">

       <div class="mbtitle">搜索中心</div>
                <div class="mbtitle2">当前位置：<a href="index.php">首页</a>&gt;<a href="news.php">新闻中心</a>&gt;新闻搜索</div>
               
    </div> 
                    <div class="clear"></div>
                    
                     <div class="info_list">
                    	
                         <?php
	$str='';

	  $page_sql='select n_id,n_class,n_image,n_title,k_description,n_date from '.$language.'_news where n_title like "%'.$keywords.'%" order by n_order,n_id';


 
		$page_size=8;
		$page_count=GetPageCount($page_size,$page_sql);
		if ($page>$page_count) $page=$page_count;
		$page_number=($page-1)*$page_size;
		$query=mysql_query($page_sql." limit $page_number,$page_size",$conn);
		if (mysql_num_rows($query)==0){
			$str.=NoData($language);
		}
		else{
		
			$str.=' <ul class="clear_both">';
			$i=1;
			while($row=mysql_fetch_array($query)){
			 $str.='<li class="fl clear_both">';
							 
                        $str.='<div class="npic2"><a href="shownews.php?id='.$row['n_id'].'"><img src="'.$row['n_image'].'"></a></div>
					<div class="npicbox2">
						<div class="npictit2"><a href="shownews.php?id='.$row['n_id'].'">'.$row['n_title'].'</a></div>
						<div class="npicdate2">'.date('Y-m-d',strtotime($row['n_date'])).'</div>
						<div class="npicinfo2">'.CutStr($row['k_description'],200).'<div class="nxx"><a href="shownews.php?id='.$row['n_id'].'">【'.$xiangxi.'】</a></div></div>
					</div>';
					
					
                            $str.='</li>';
				$i++;
			}
			$str.='</ul>';
			
			if ($page_count>1) $str.='<div id="products_page">'.ShowPage3($page,$page_count,$language).'</div>';
		}
		echo $str;
		?>
          
                    </div>
                    
                </div>   
            </div>
        </div>
        
        
<?php require 'footer.php'?>



</body>
</html>

